home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 304 < prev    next >
Encoding:
Text File  |  1996-08-06  |  2.6 KB  |  56 lines

  1. Newsgroups: comp.lang.c,comp.std.c
  2. Path: bln.sel.alcatel.de!slsv6bt!slsv6bt!kanze
  3. From: kanze@lts.sel.alcatel.de (James Kanze US/ESC 60/3/141 #40763)
  4. Subject: Re: Integral conversion e.t.c. (was: Re: Hungarian notation)
  5. In-Reply-To: ENGR@GSSI.MV.COM's message of Fri, 2 Feb 1996 18:16:31 GMT
  6. Message-ID: <KANZE.96Feb5133404@slsvewt.lts.sel.alcatel.de>
  7. Sender: news@lts.sel.alcatel.de
  8. Organization: SEL
  9. References: <30C40F77.53B5@swsbbs.com> <SPENCER.96Jan22113215@zorgon.ERA.COM>
  10.     <KANZE.96Feb2133347@slsvewt.lts.sel.alcatel.de> <DM5urJ.Aq5@mv.mv.com>
  11. Date: 05 Feb 1996 12:34:04 GMT
  12.  
  13. In article <DM5urJ.Aq5@mv.mv.com> ENGR@GSSI.MV.COM (Michael Furman)
  14. writes:
  15.  
  16. |> In article <KANZE.96Feb2133347@slsvewt.lts.sel.alcatel.de>, 
  17. |> kanze@lts.sel.alcatel.de says...
  18. |> >  ..................................
  19. |> >Note that implementations *are* allowed to offer extensions, and
  20. |> >define undefined behavior in an implementation specific manner.  An
  21. |> >implementation which defines, for example, that writing to the address
  22. |> >0 clears the screen, is perfectly legal.  If you write code uniquely
  23. |> >for that implementation, and you have to clear the screen, you will
  24. |> >dereference a null pointer.  If this is the only way of clearing the
  25. |> >screen on said implementation, and your application requires clearing
  26. |> >the screen, you will write code dereferencing a null pointer.
  27. |> >
  28. |> >That doesn't make such code any less undefined with regards to the
  29. |> >standard.
  30.  
  31. |> I can not say that I agree ... Of cause some implementation may define
  32. |> any "undefined" behavior. But I still see two very different cases -
  33. |> a) when construction assumed as incorrect, like dereferinsing wrong
  34. |> pointer and when it has clear purpose, but exect meaning can not be
  35. |> defined portable (like "asm").
  36.  
  37. |> What do you think about code with "asm" statements. Is it "less undefined" 
  38. |> and if not - what is the sense and reason of including
  39. |> "asm" keyword in the standard?
  40.  
  41. There is no `asm' keyword in the C standard.
  42.  
  43. I do see a difference in using an `asm' extension (with the meaning as
  44. in classical C) and dereferencing a null pointer, in that the first is
  45. not undefined behavior; it requires a diagnostic, so presumably,
  46. anyone porting my code will stumble across it, and realize that they
  47. have a portability problem.
  48.  
  49. But this only works because `asm' is *not* undefined behavior.
  50. --
  51. James Kanze         Tel.: (+33) 88 14 49 00        email: kanze@gabi-soft.fr
  52. GABI Software, Sarl., 8 rue des Francs-Bourgeois, F-67000 Strasbourg, France
  53. Conseils, Θtudes et rΘalisations en logiciel orientΘ objet --
  54.                 -- A la recherche d'une activitΘ dans une region francophone
  55.  
  56.